<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>msg-充值</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <base href="./../../">
    <base target="_blank">
    <link rel="shortcut icon" href="favicon.ico"> <link href="assets/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="assets/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="assets/css/animate.min.css" rel="stylesheet">
    <link href="assets/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="assets/plugins/iCheck/custom.css" rel="stylesheet">
    

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="commentForm">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">账号：</label>
                                <div class="col-sm-4">
                                    <input id="account" name="account" minlength="2" type="text" class="form-control" required="" aria-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">金额：</label>
                                <div class="col-sm-4">
                                    <input id="money" type="text" class="form-control" name="money" required="" aria-required="true">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                    <button class="btn btn-primary" type="button" onclick="topUp()">提交</button>
                                    <button class="btn btn-default" type="button" onclick="closeWin()">关闭</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <script type="text/javascript" src="config.js"></script>
    <script type="text/javascript" src="assets/js/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="assets/js/bootstrap.min.js?v=3.3.5"></script>
    <script type="text/javascript" src="assets/js/axios.min.js"></script>
    <script type="text/javascript" src="assets/js/formSerialize.js"></script>
    <script type="text/javascript" src="assets/js/common.js"></script>
    <script type="text/javascript" src="assets/plugins/layer/layer_v3.1.1/layer.js"></script>
    <script type="text/javascript" src="assets/plugins/iCheck/icheck.min.js"></script>
    <script>

        //充值
        function topUp(){
            var param = {};
        	var formArr = $("#commentForm").serializeArray();  
        	$.each(formArr,function(i, obj){
        		param[obj.name] = obj.value;
            });
            
            if(param.money==""){
                layer.msg("请输入金额！")
                return false;
            };
            if(param.account==""){
                layer.msg("请输入账号！")
                return false;
            };
            layer.load(0);
            axios.post('/xinmaTrading/topUp/api',param)
                .then(function (response) {
                    layer.closeAll('loading');
                    layer.msg(response.msg);
                    if(response.result){
                       $('#money').val('');
                    }
                    
                })


        }

        // 关闭页面
        function closeWin(){
			window.location.href = "index.html";    
        }
        
    </script>
</body>

</html>